from django.db.models import CharField,ForeignKey,DateTimeField,IntegerField,BooleanField,DateField,DecimalField,TextField,DO_NOTHING,PROTECT
from apps.vadmin.op_drf.models import CoreModel


class Components_Assets(CoreModel):
    component= ForeignKey(to="assets.Components",null=True,db_constraint=False,on_delete=PROTECT,verbose_name="关联的组件Id")
    asset = ForeignKey(to="assets.Assets",null=True,db_constraint=False,on_delete=PROTECT,verbose_name="关联的资产Id")
    notes = CharField(max_length=256,null=True,verbose_name="备注")
    qty = IntegerField(null=True,default=0,verbose_name="数量")

    class Meta:
        verbose_name = '组件资产关系表'
        verbose_name_plural = verbose_name
        ordering = ['-id']
